package com.yunkaweilai.android.view.home;

import android.app.Activity;
import android.view.View;
import android.widget.ListView;

import com.yunkaweilai.android.R;
import com.yunkaweilai.android.model.CountIncomeBean;
import com.yunkaweilai.android.model.CountTopLIstBean;

import java.util.ArrayList;
import java.util.List;

/**
 * 无热销产品时的视图
 */
public class CountNoTopListView extends AbsHeaderView<CountIncomeBean.DataBean>{

    public CountNoTopListView(Activity activity) {
        super(activity);
    }

    @Override
    protected void getView(CountIncomeBean.DataBean dataBean, ListView listView) {
        View view = mInflate.inflate(R.layout.count_empty_top_list, listView, false);
        view.setTag("empty");
        listView.addHeaderView(view);
    }

    public void refresh(ArrayList<CountTopLIstBean.DataBean.Goods> list, ListView listView){
        if (!list.isEmpty()){
            View view = listView.findViewWithTag("empty");
            if (view != null)
            listView.removeHeaderView(view);
        }
    }
}
